<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>优秀作品</title>

    <meta name="description" content="Static &amp; Dynamic Tables" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/font-awesome.min.css" />
    <link rel="stylesheet" href="../css/ace-fonts.css" />
    <link rel="stylesheet" href="../css/ace.min.css" id="main-ace-style" />
    <link rel="stylesheet" href="../css/ace-skins.min.css" />
    <link rel="stylesheet" href="../css/ace-rtl.min.css" />
    <link rel="stylesheet" href="../css/style.css" />
    <script src="../js/ace-extra.min.js"></script>
    
	<script type="text/javascript">
	    window.jQuery || document.write("<script src='../js/jquery.min.js'>"+"<"+"/script>");
	    var basePath = "/KidEdu";
	    var tid="${T_id}";
	    
	</script>

	<script src="../js/bootstrap.min.js"></script>
	
	<script src="../js/jquery.page.js"></script>
	
	<script src="../js/angular.min.js"></script>
	<script src="../js/ui-bootstrap-tpls.js"></script>
	<link rel="stylesheet" href="../css/toastr.css" />
	<script src="../js/toastr.js"></script>
	
<!-- 	<script src="../js/jquery-ui.custom.min.js"></script>
	<script src="../js/jquery.ui.touch-punch.min.js"></script>
	<script src="../js/chosen.jquery.min.js"></script>
	<script src="../js/jquery.autosize.min.js"></script>
	<script src="../js/jquery.inputlimiter.1.3.1.min.js"></script>
	<script src="../js/jquery.maskedinput.min.js"></script>
	<script src="../js/ace-elements.min.js"></script>
	<script src="../js/ace.min.js"></script> -->
</head>

<body class="no-skin">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small>
                    <i class="fa fa-leaf"></i>
                   	 小黄莺艺术学校 | Admin
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="green">
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <i class="ace-icon fa fa-envelope icon-animated-vertical"></i>
                    </a>
                </li>
                
                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="../assets/avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info">
									<small>Welcome,</small>
									Zy
								</span>

                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a href="#">
                                <i class="ace-icon fa fa-cog"></i>
                                Settings
                            </a>
                        </li>

                        <li class="divider"></li>

                        <li>
                            <a href="#">
                                <i class="ace-icon fa fa-power-off"></i>
                                Logout
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="main-container" id="main-container">
    <div id="sidebar" class="sidebar responsive">
        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                <button class="btn btn-success">
                    <i class="ace-icon fa fa-signal"></i>
                </button>

                <button class="btn btn-info">
                    <i class="ace-icon fa fa-pencil"></i>
                </button>

                <button class="btn btn-warning">
                    <i class="ace-icon fa fa-users"></i>
                </button>

                <button class="btn btn-danger">
                    <i class="ace-icon fa fa-cogs"></i>
                </button>
            </div>
        </div>

        <ul class="nav nav-list">
            <!-- <li>
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-list"></i>
                    <span class="menu-text"> 系统管理员 </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="active">
                        <a href="ClassPreset.html">
                            <i class="menu-icon fa fa-caret-right"></i>
                            	班级预设
                        </a>
                    </li>
                    <li>
                        <a href="CourseApproval.html">
                            <i class="menu-icon fa fa-caret-right"></i>
                            	课程审定
                        </a>
                    </li>
                </ul>
            </li> -->
            <li class="active open">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-list"></i>
                    <span class="menu-text"> 班主任 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li>
                        <a href="${ctx}/teacher/artShow">
                            <i class="menu-icon fa fa-caret-right"></i>
                           		 优秀作品
                        </a>
                    </li>
                    <li class="active">
                        <a href="${ctx}/teacher/kidManage">
                            <i class="menu-icon fa fa-caret-right"></i>
                           		 幼儿管理
                        </a>
                    </li>
                </ul>
            </li>
        </ul>

        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>
    </div>

    <div class="main-content"  ng-controller="kidData">
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="#">班主任</a>
                </li>
                <li class="active">幼儿管理</li>
            </ul>

            <!-- <div class="nav-search" id="nav-search">
                <form class="form-search">
					<span class="input-icon">
						<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" ng-model="keyword"/>
						<i class="ace-icon fa fa-search nav-search-icon"></i>
					</span>
					<button class="btn btn-minier btn-blue" ng-click="selectKArtListByDate()">搜索</button>
                </form>
            </div> -->

        </div>

       <!--  <div class="ace-settings-container" id="ace-settings-container">
            <a href="#addKArt" role="button" class="green" data-toggle="modal">
                <button class="btn btn-info">上传作品</button>
            </a>
        </div> -->

        <div class="page-content">
            <div class="page-content-area">
                <div class="page-header">
                    <h1>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                       		幼儿管理
                    </h1>
                </div>

                <div class="row">
                    <div class="col-xs-12">
                        <div>
                           <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                           		<thead>
									<tr>
										<th>姓名</th>
										<th>性别</th>
										<th>开始年份</th>
										<th>开始班级</th>
										<th>所在班级</th>
										<th>监护人姓名</th>
										<th>监护人联系方式</th>
										<th>操作</th>
									</tr>
								</thead>
								
								<tbody>
									<tr ng-repeat="kStudent in kKidList">
										<td ng-bind="kStudent.susername"></td>
										<td ng-bind="kStudent.ssex"></td>
										<td ng-bind="kStudent.sbeginyear"></td>
										<td ng-bind="kStudent.sbegingrade"></td>
										<td ng-bind="kStudent.sclass"></td>
										<td ng-bind="kStudent.sparentname"></td>
										<td ng-bind="kStudent.sparenttel"></td>
										<td>
											<div class="hidden-sm hidden-xs action-buttons">
												<a href="#modal-table" role="button" class="green" data-toggle="modal" ng-click="showKKid(kStudent.sid,kStudent.sparentname,kStudent.sparenttel)">
													<i class="ace-icon fa fa-pencil bigger-130"></i>
												</a>

												<a class="red" href="javascript:void(0);" ng-click="deleteKKid(kStudent.sid)">
													<i class="ace-icon fa fa-trash-o bigger-130"></i>
												</a>
											</div>
										</td>
									</tr>
								</tbody>
                           </table>
                           
                           <div class="tcdPageCode"></div>
                         
                        </div>
                    </div>
                </div>
                
                <div id="modal-table" class="modal fade" tabindex="-1">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header no-padding">
								<div class="table-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
										<span class="white" ng-model="SId">&times;</span>
									</button>
									幼儿信息修改
								</div>
							</div>

							<div class="modal-body no-padding">
								<!-- <div style="padding:10px;">
									<span style="font-size:14px;">姓名</span>
									<input style="margin-left:20px;" type="text"></input>
								</div>
								
								<div style="padding:10px;">									
									<div class="control-group">
										<div class="radio">
											<span style="font-size:14px;">性别</span>
											<label>
												<input name="form-field-radio" class="ace" type="radio" value="男" ng-model="AType">
												<span class="lbl">男</span>
											</label>
											<label>
												<input name="form-field-radio" class="ace" type="radio" value="女" ng-model="AType">
												<span class="lbl">女</span>
											</label>
										</div>
									</div>
								</div>

								<div style="padding:10px;">
									<span style="font-size:14px;">开始年份</span>
									<input style="margin-left:20px;" type="text"></input>
								</div>

								<div style="padding:10px;">
									<span style="font-size:14px;">开始班级</span>
									<input style="margin-left:20px;" type="text" ng-model="Sbegingrade"></input>
								</div>
 -->
								<div style="padding:10px;">
									<span style="font-size:14px;">监护人姓名</span>
									<input style="margin-left:20px;" type="text" ng-model="Sparentname"></input>
								</div>

								<div style="padding:10px;">
									<span style="font-size:14px;">监护人联系方式</span>
									<input style="margin-left:20px;" type="text" ng-model="Sparenttel"></input>
								</div>
							</div>

							<div class="modal-footer no-margin-top">
								<button class="btn btn-sm btn-success pull-left" data-dismiss="modal" ng-click="updateKKId()">
									<i class="ace-icon fa fa-check-square-o"></i>
										保存
								</button>
							</div>
						</div>
					</div>
				</div>               
            </div>
        </div>
        
        
        
                  
    </div>

    <div class="footer">
        <div class="footer-inner">
            <div class="footer-content">
				 <span class="bigger-120">
				       <span class="blue bolder">KID</span>
					   Education &copy; 2016
				 </span>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

	    var m = angular.module('myApp', []);
		m.controller('kidData', ['$scope', '$http', function($scope, $http){
			$scope.pageNo = 1;
			$scope.t_id = tid;
			
			/* 查看幼儿列表 */
			$scope.selectKidList = function (){
				
				$http({
			          url:'KStuAction!selectKidList',
			          method:'get',
			          params:
			          {
			            'pageNo' : $scope.pageNo,
			            't_id' : $scope.t_id
			          }
			        }).success(function(data, status, headers, config){
			        	for(var i=0;i<data.KKidPagList.list.length;i++){
			        		var type = data.KKidPagList.list[i].ssex;
			        		if(type == "1"){
			        			type = "男";
			        		}else{
			        			type = "女";
			        		}
			        		data.KKidPagList.list[i].ssex = type;
			        	}
			        	$scope.kKidList = data.KKidPagList.list;
			        	
			        	$(".tcdPageCode").createPage({
			    		    pageCount:data.KKidPagList.totalPage,
			    		    current:$scope.pageNo,
			    		    backFn:function(p){
			    		        //console.log(p);
			    		        $scope.pageNo = p;
			    		        $scope.selectKidList();
			    		    }
			    		});
			        }).error(function(data, status, headers, config){
			          //处理响应失败
			          toastr.error("请求失败！");
			    });
			};
			
			$scope.selectKidList();
		
			/* 修改幼儿列表 */
			$scope.showKKid = function (Sid,Sparentname,Sparenttel){
				$scope.Sid = Sid;
				$scope.Sparentname = Sparentname;
				$scope.Sparenttel = Sparenttel;
			};
			
			$scope.updateKKId = function (){
			    //alert($scope.Sid);
				$http({
			          url:'KStuAction!updateKid',
			          method:'get',
			          params:
			          {
			            'S_id' : $scope.Sid,
			            'Sparentname' : $scope.Sparentname,
			            'Sparenttel' : $scope.Sparenttel,
			          }
			        }).success(function(data, status, headers, config){
			          toastr.success("修改成功！");
			          $scope.selectKidList();
			        }).error(function(data, status, headers, config){
			          //处理响应失败
			          toastr.error("请求失败！");
			    });
			};
			
			/*删除作品*/
			$scope.deleteKKid = function (SId){
				if (confirm("确定要删除吗？")){
			    	toastr.error("被使用中，无法删除！");
			    	/* $http({
				          url:'admin/KStuAction!deleteKKid',
				          method:'get',
				          params:
				          {
				            'S_id' : SId,
				          }
				        }).success(function(data, status, headers, config){
				          alert("删除成功！");
				          $scope.selectKidList();
				        }).error(function(data, status, headers, config){
				          //处理响应失败
				          alert("请求失败！");
				    }); */
			    }else{
			    	
			    }
			};			
		}]); 
</script>


<script type="text/javascript">
			
</script>
</body>
</html>